package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.po.ReplyDTO;
import com.tianji.learning.domain.po.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-12-18
 */
@RestController
@RequestMapping("/replies")
@Api(tags = "互动问题的回答或评论相关接口")
public class InteractionReplyController {
    @Autowired
    private IInteractionReplyService replyService;
    @PostMapping
    @ApiOperation("新增互动回答")
    public void addReply(ReplyDTO dto) {
        replyService.addReply(dto);
    }

    @GetMapping("/page")
    @ApiOperation("分页查询互动回答")
    public PageDTO<ReplyVO> replyPage(ReplyPageQuery query){
        return replyService.replyPage(query);
    }
}
